<?php

namespace App\Http\Controllers\admin\api;

use App\Http\Controllers\admin\service\WhiteAppService;
use App\Http\Controllers\admin\validate\WhiteApp;
use App\Http\Controllers\util\ToolUtil;
use Illuminate\Http\Request;

class WhiteAppApi
{

    public function whiteAppList(Request $request){
        $param = $request->all();
        $data = WhiteApp::whiteAppList($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return WhiteAppService::whiteAppList($param);
    }

    public function whiteAppById(Request $request){
        $param = $request->all();
        $data = WhiteApp::whiteAppById($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return WhiteAppService::whiteAppById($param);
    }

    public function whiteAppAdd(Request $request){
        $param = $request->all();
        $data = WhiteApp::whiteAppAdd($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return WhiteAppService::whiteAppAdd($param);
    }

    public function whiteAppEdit(Request $request){
        $param = $request->all();
        $data = WhiteApp::whiteAppEdit($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return WhiteAppService::whiteAppEdit($param);
    }

    public function whiteAppDelete(Request $request){
        $param = $request->all();
        $data = WhiteApp::whiteAppDelete($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return WhiteAppService::whiteAppDelete($param);
    }


}
